package com.yinhai.msg.systemChannel.service.read.impl;


import com.yinhai.msg.systemChannel.entity.MsgSystemChannelPo;
import com.yinhai.msg.systemChannel.entity.MsgSystemDicPo;
import com.yinhai.msg.systemChannel.mapper.read.MsgSystemChannelReadMapper;
import com.yinhai.msg.systemChannel.service.read.MsgSystemChannelReadService;
import com.yinhai.ta404.core.restservice.requestbean.PageParam;
import com.yinhai.ta404.core.restservice.resultbaen.Page;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 系统绑定渠道服务层实现类
 * @author: zhangxj
 * @create: 2019-05-24 14:49
 */
@Service("SystemBindingReadService")
@TaTransactional
public class MsgSystemChannelReadServiceImpl implements MsgSystemChannelReadService {
    @Resource
    private MsgSystemChannelReadMapper msgSystemChannelReadMapper;

    @Override
    public Page<MsgSystemChannelPo> queryAll(MsgSystemChannelPo msgSystemChannelPo, PageParam pageParam) {
        msgSystemChannelReadMapper.beginPager(pageParam);
        return msgSystemChannelReadMapper.endPager(msgSystemChannelReadMapper.queryAll(msgSystemChannelPo));

    }

    @Override
    public Page<MsgSystemChannelPo> queryChannel(MsgSystemChannelPo msgSystemChannelPo, PageParam pageParam) {
        Page<MsgSystemChannelPo> result=null;
        msgSystemChannelReadMapper.beginPager(pageParam);
        switch (msgSystemChannelPo.getChanneltype()){
            case  "3":result= msgSystemChannelReadMapper.endPager(msgSystemChannelReadMapper.queryEmailChannel(msgSystemChannelPo));
            break;
        }
        return result;
    }

    @Override
    public List<MsgSystemDicPo> queryMsgSystem() {
        return msgSystemChannelReadMapper.queryMsgSystem();
    }
}
